import "@site/src/languages/highlight";

# PlatformCamera

**Description:**

&emsp;&emsp;A platform camera for 2D platformer games that can track a game unit's movement and keep it within the camera's view.

**Class Object:** [Platformer.PlatformCamera Class](/docs/api/Class%20Object/Platformer/PlatformCamera).

**Inherits from:** [Camera](/docs/api/Class/Camera).

## position

**Type:** Field.

**Description:**

&emsp;&emsp;The camera's position.

**Signature:**
```tl
position: Vec2
```

## rotation

**Type:** Field.

**Description:**

&emsp;&emsp;The camera's rotation in degrees.

**Signature:**
```tl
rotation: number
```

## zoom

**Type:** Field.

**Description:**

&emsp;&emsp;The camera's zoom factor, 1.0 means the normal size, 2.0 mean zoom to doubled size.

**Signature:**
```tl
zoom: number
```

## boundary

**Type:** Field.

**Description:**

&emsp;&emsp;The rectangular area within which the camera is allowed to view.

**Signature:**
```tl
boundary: Rect
```

## followRatio

**Type:** Field.

**Description:**

&emsp;&emsp;The ratio at which the camera should move to keep up with the target's position.
For example, set to `Vec2(1.0, 1.0)`, then the camera will keep up to the target's position right away.
Set to Vec2(0.5, 0.5) or smaller value, then the camera will move halfway to the target's position each frame, resulting in a smooth and gradual movement.

**Signature:**
```tl
followRatio: Vec2
```

## followOffset

**Type:** Field.

**Description:**

&emsp;&emsp;The offset from the target's position that the camera should follow.

**Signature:**
```tl
followOffset: Vec2
```

## followTarget

**Type:** Field.

**Description:**

&emsp;&emsp;The game unit that the camera should track.

**Signature:**
```tl
followTarget: Node
```